#include <iostream>
#include <Eigen/Dense>

using namespace std;
using namespace Eigen;

int main() {
    Vector3d v(1, 2, 3);
    cout << "ori vector:\n" << v << endl;
    cout << "* result:\n" << v * 3 << endl;
    // 点乘
    cout << "dot result:\n" << v.dot(v) << endl;
    // 叉乘
    cout << "cross result:\n" << v.cross(v) << endl;


    cout << "----------" << endl;
    Vector3d v2(4, 5, 6);
    cout << "ori vector:\n" << v+v2 << endl;
    // cout << "* result:\n" << v * 3 << endl;
    // 点乘
    cout << "dot result:\n" << v.dot(v2) << endl;
    // 叉乘
    cout << "cross result:\n" << v.cross(v2) << endl;

    return 0;
}

/*
点乘 = 向量的内积
差乘 = 向量的外积
数学定义,推导:
    矩阵和向量的乘法---点乘、叉乘、内积、外积、数乘 https://www.jianshu.com/p/9165e3264ced

 */